<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var myobj = new Object()
			myobj.color="red";
			myobj.price=1200;
			myobj.run=function(){
				document.write(this.color+","+this.price+"</br>")
			}
			
			myobj.run();
			
			//使用构造方法
			function Car(color,price){
				this.color=color;
				this.price=price;
				this.run=function(){
				
				document.write(this.color+","+this.price+"</br>")
			
				}
			}
			
			var c = new Car("black",3200);
			c.run();
			
			//使用prototype扩展和集成对象
			Car.prototype.walk=function()
			{
				document.write(this.color+","+this.price+"walk</br>");
			}
			c.walk();
		</script>
	</head>
	<body>
	</body>
</html>
